import http from '../index'

// 分页获取参数信息
export const getConfigs = ({ ascended = null, current = null, size = null, sortFieldName = null, configKey = null, configName = null, }) => {
    return http.get("configs", { ascended, current, size, sortFieldName, configKey, configName })
}

// 根据sid获取参数信息
export const getConfigDetail = ({ sid }) => {
    return http.get("configs/" + sid)
}

// 新增参数信息
export const addConfig = ({ configKey, configName, configValue, deletable = null, note = null, status = null }) => {
    return http.post("configs", { configKey, configName, configValue, deletable, note, status })
}

// 修改参数信息
export const editConfig = ({ sid, configKey, configName, configValue, deletable = null, note = null, status = null }) => {
    return http.put("configs/" + sid, { configKey, configName, configValue, deletable, note, status })
}

// 批量删除参数信息
export const delConfigs = ({ sidList }) => {
    return http.put("configs/delete", { sidList })
}
